<template>
	<view class="kda">
		<view class="title" v-for="(v,i) in k" :key="i">
			<view class="top">
				<view class="kda2" v-if="k2==i">
					&lt;{{v.title}}<text class="kda3" @click="dj(i)">&gt;</text>
				</view>
				
			</view>
		
			
			
		</view>
		<view class="bottom" v-for="(item,index) in k3" :key="index">
			<view class="mock" >
				{{item.title}}
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		name:"CardOne",
		data() {
			return {
				k:[],
				k2:0,
				k3:[],
				curpage:5,
			};
		},
		mounted() {
			this.getList1()
		},
		
		methods:{
			async getList1() {
				const _this = this 
					const data1 = await uni.request({
						url:'https://cm.happycheer.com/cmVars/getVariableInfoByKey?key=TEST_MSG_en-IN_newsList&format=api',// mock地址
						method:'POST',
						success(res) {
							console.log(res.data.data['TEST_MSG_en-IN_newsList'],'res');
							_this.k = []
							_this.k=(res.data.data['TEST_MSG_en-IN_newsList']) 	
							_this.k.forEach((v,i)=>{
								let vs = v
								if(_this.k2==i){
									_this.k3=vs.list.slice(0,5)
									console.log(_this.k3,'k32');
									// throw('中止循环')
								}
								
							})
						},
					})
				
				console.log(data1,"data1");
				
			},
			dj(l){
				console.log(this.k3,"k3");
				l+1>2? this.k2=0:this.k2=l+1
				this.k.forEach((v,i)=>{
					let vs = v
					if(this.k2==i){
						this.k3=vs.list.slice(l*5,(1+l)*5)
						console.log(this.k3,'k32');
						// throw('中止循环')
					}
					
				})
					console.log(this.k2);
					
			}
			
		}
	}
</script>

<style scoped>
.kda{
		width: 730rpx;
		/* height: 350rpx; */
		margin: 0 auto;
		border-radius: 25rpx;
		background-color: slategray;
		color: white;
		position: relative;
	}
	.kda3{
		width: 50rpx;
	}

</style>